package org.example.operator;

import java.math.BigDecimal;
import java.math.RoundingMode;

/**
 * 除法具体实现
 * @author Silver
 */
public class Divide extends ComplexNumberOperator{

    private RoundingMode roundingMode = RoundingMode.HALF_UP;

    @Override
    public BigDecimal numberOperator(BigDecimal num1, BigDecimal num2) {
        return num1.divide(num2, roundingMode);
    }

    public void setRoundingMode(RoundingMode roundingMode) {
        this.roundingMode = roundingMode;
    }
}
